-
Notifications
You must be signed in to change notification settings - Fork 29
chore: add testcases for k8s packages #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7776b2d
to
2045484
Compare
Signed-off-by: Lan <[email protected]>
2045484
to
029273a
Compare
error[E2G22]: TypeError
--> /home/runner/work/modules/modules/k8s/1.32/api/networking/v1/ingress_backend.k:22:16
|
22 | resource?: v1.TypedLocalObjectReference
| ^ attribute 'TypedLocalObjectReference' not found in 'module 'k8s.apimachinery.pkg.apis.meta.v1''
|
[recovered]
panic:
error[E2L23]: CompileError
--> /home/runner/work/modules/modules/k8s/1.32/api/networking/v1/ingress_backend.k:6:1
|
6 | import api.core.v1
| ^ the name 'v1' is defined multiple times, 'v1' must be defined only once
|
error[E2G22]: TypeError
--> /home/runner/work/modules/modules/k8s/1.32/api/networking/v1/ingress_backend.k:22:16
|
22 | resource?: v1.TypedLocalObjectReference
| ^ attribute 'TypedLocalObjectReference' not found in 'module 'k8s.apimachinery.pkg.apis.meta.v1'' it's happenning on kcl-go v1.11.1,and i think change |
Signed-off-by: Lan <[email protected]>
Signed-off-by: liangyuanpeng <[email protected]>
generate k8s 1.32.4 with the following changes: always imports package asName and asName always with ++ strs := strings.Split(innerPkg, ".")
++ importpkg := strs[len(strs)-2] + strs[len(strs)-1]
imp[sch.Pkg] = importStmt{
ImportPath: innerPkg, // remove the root package name
-- AsName: asName,
++ AsName: importpkg,
// MustAsName: asName != sch.Pkg[strings.LastIndex(sch.Pkg, ".")+1:],
// if the package alias is conflict with other imports, use the `import as` syntax to resolve conflict.
-- MustAsName: asName != sch.Pkg[strings.LastIndex(sch.Pkg, ".")+1:],
++ MustAsName: true,
} And CI is green, so this PR can be merge and continue for k8s 1.33. @Peefy |
Good Job! Thank you! |
Due to main_test.go has changed, main.go fails to run. I will fix it. https://github.com/kcl-lang/modules/actions/runs/14854063178/job/41703108401 |
releated:
1. Please confirm that you have read the document before PR submitted
2. Contact Information(Optional)
If it is convenient, please provide your contact information so we can reach you when processing the PR: